home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / rbbs_pc / 173basm.zip / BASNOV.ASM < prev    next >
Assembly Source File  |  1989-01-09  |  2KB  |  90 lines

  1. ;---------------
  2. ; ██████████████████████████████████████████████
  3. ; █████████████ BASNOV 0.01 ████████████████████
  4. ; ██████████████████████████████████████████████
  5. ; █████████████ ASSEMBLE WITH MASM 5.1 █████████
  6. ; ██████████████████████████████████████████████
  7. ;---------------
  8.         .model    medium,basic
  9. ;---------------
  10.         .data
  11.  
  12. FileName    db    128 dup (0)        ; buffer for filename
  13. ;---------------
  14.         .code
  15. ;---------------
  16. ; CheckNovell(Err%)
  17. ;
  18. ; return values for Err% :
  19. ;
  20. ;    0    if Netware installed
  21. ;   -1    if Netware not installed
  22. ;
  23. CheckNovell    proc    Err:word
  24.  
  25.         mov    ax,0B600h        ; get station number
  26.         int    21h
  27.         or    al,al            ; Netware loaded ?
  28.         jz    Error
  29.  
  30.         xor    ax,ax            ; return  0 if no error
  31.         jmp    short Exit
  32.  
  33. Error:        mov    ax,-1            ; return -1 if error
  34.  
  35. Exit:        mov    bx,[Err]        ; set result to Err%
  36.         mov    [bx],ax
  37.         ret
  38.  
  39. CheckNovell    endp
  40. ;---------------
  41. ;  SetSharedAttr(FileName$, Err%)
  42. ;
  43. ;  return values for Err% :
  44. ;
  45. ;     0     no error reported by DOS
  46. ;    -1        error reported by DOS
  47. ;
  48. SetSharedAttr    proc    Filename:ptr, Err:word
  49.  
  50.         mov    bx,[Filename]        ; ptr to string descriptor
  51.         mov    si,[bx+2]        ; fetch string address
  52.         mov    cx,[bx]         ; length of string
  53.  
  54.         mov    ax,@data        ; ES:DI points to local buffer
  55.         mov    es,ax
  56.         mov    di,offset FileName
  57.         mov    dx,di            ; copy offset into DX
  58.         rep    movsb            ; copy string contents
  59.         mov    al,0            ; make string ASCIIZ
  60.         stosb
  61.  
  62.         push    ds            ; save DS temp
  63.  
  64.         mov    ax,es            ; make DS equal to ES
  65.         mov    ds,ax
  66.  
  67.         mov    ax,04300h        ; CHMOD, get attribute
  68.         int    21h
  69.         jc    Error            ; check for error
  70.  
  71.         or    cx,0080h        ; set shared bit
  72.  
  73.         mov    ax,04301h        ; CHMOD, set attribute
  74.         int    21h
  75.         jc    Error            ; check for error
  76.  
  77.         xor    ax,ax            ; set Err% to  0
  78.         jmp    short Exit
  79.  
  80. Error:        mov    ax,-1            ; set Err% to -1
  81.  
  82. Exit:        pop    ds            ; restore DS
  83.         mov    bx,[Err]        ; offset of Err%
  84.         mov    [bx],ax         ; store result
  85.         ret                ; return
  86.  
  87. SetSharedAttr    endp
  88. ;---------------
  89.         end
  90.